package com.ruoyi.system.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; //添加
import com.ruoyi.common.utils.xuehua.SnowflakeIdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.GradedAlarmHistoryMapper;
import com.ruoyi.system.domain.GradedAlarmHistory;
import com.ruoyi.system.service.IGradedAlarmHistoryService;

/**
 * 分级报警历史Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-19
 */
@Service
public class GradedAlarmHistoryServiceImpl extends ServiceImpl<GradedAlarmHistoryMapper, GradedAlarmHistory> implements IGradedAlarmHistoryService //修改
{
    @Autowired
    private GradedAlarmHistoryMapper gradedAlarmHistoryMapper;

    /**
     * 查询分级报警历史
     * 
     * @param gradedAlramHistoryId 分级报警历史主键
     * @return 分级报警历史
     */
    @Override
    public GradedAlarmHistory selectGradedAlarmHistoryByGradedAlramHistoryId(String gradedAlramHistoryId)
    {
        return gradedAlarmHistoryMapper.selectGradedAlarmHistoryByGradedAlramHistoryId(gradedAlramHistoryId);
    }

    /**
     * 查询分级报警历史列表
     * 
     * @param gradedAlarmHistory 分级报警历史
     * @return 分级报警历史
     */
    @Override
    public List<GradedAlarmHistory> selectGradedAlarmHistoryList(GradedAlarmHistory gradedAlarmHistory)
    {
        return gradedAlarmHistoryMapper.selectGradedAlarmHistoryList(gradedAlarmHistory);
    }

    /**
     * 新增分级报警历史
     * 
     * @param gradedAlarmHistory 分级报警历史
     * @return 结果
     */
    @Override
    public int insertGradedAlarmHistory(GradedAlarmHistory gradedAlarmHistory)
    {
        gradedAlarmHistory.setGradedAlramHistoryId(String.valueOf(new SnowflakeIdUtils(5,8).nextId()));
        return gradedAlarmHistoryMapper.insertGradedAlarmHistory(gradedAlarmHistory);
    }

    /**
     * 修改分级报警历史
     * 
     * @param gradedAlarmHistory 分级报警历史
     * @return 结果
     */
    @Override
    public int updateGradedAlarmHistory(GradedAlarmHistory gradedAlarmHistory)
    {
        return gradedAlarmHistoryMapper.updateGradedAlarmHistory(gradedAlarmHistory);
    }

    /**
     * 批量删除分级报警历史
     * 
     * @param gradedAlramHistoryIds 需要删除的分级报警历史主键
     * @return 结果
     */
    @Override
    public int deleteGradedAlarmHistoryByGradedAlramHistoryIds(String[] gradedAlramHistoryIds)
    {
        return gradedAlarmHistoryMapper.deleteGradedAlarmHistoryByGradedAlramHistoryIds(gradedAlramHistoryIds);
    }

    /**
     * 删除分级报警历史信息
     * 
     * @param gradedAlramHistoryId 分级报警历史主键
     * @return 结果
     */
    @Override
    public int deleteGradedAlarmHistoryByGradedAlramHistoryId(String gradedAlramHistoryId)
    {
        return gradedAlarmHistoryMapper.deleteGradedAlarmHistoryByGradedAlramHistoryId(gradedAlramHistoryId);
    }
}
